package com.dongecloud.openfeign;

import com.donge.bean.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class HelloServiceFallBackFactory implements FallbackFactory<HelloService> {
    @Override
    public HelloService create(Throwable throwable) {
        return new HelloService() {
            @Override
            public String hello() {
                return "又出错啦，赶紧啊";
            }

            @Override
            public String hello1(String name) {
                return null;
            }

            @Override
            public User addUser2(User user) {
                return null;
            }

            @Override
            public void updateUser2(User user) {

            }

            @Override
            public void deleteUser2(Integer id) {

            }
        };
    }
}
